package com.future.bantang.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.future.bantang.fragment.SearchInventoryFragment;
import com.future.bantang.fragment.SearchSingleProductFragment;

/**
 * Created by zzh on 2016/1/16.
 */
public class SearchActFraPagerAdapter extends FragmentPagerAdapter{
    String[] titles={"单品","清单"};

    public SearchActFraPagerAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        if (position==0) {
            //返回单品
            return new SearchSingleProductFragment();

        }else if (position==1) {
            //返回清单
            return new SearchInventoryFragment();
        }

        return null;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return titles[position];
    }

    @Override
    public int getCount() {
        return titles.length;
    }
}
